<?php if(isset($view_only) && $view_only) {
if($access['status'] == Model_UserRelations::MYSELF)
{?>
<a href="<?php echo My_URL::app_url('user/editprofile');?>">edit profile</a><?php 
}
else if($access['status'] == Model_UserRelations::PENDING_COUPLE) 
{
	if($my_uid == $access['sender_uid']) echo "Awaiting couple confirmation";
	else echo "accept couple request from email.";
}
else if($access['status'] == Model_UserRelations::COUPLE) 
{
	echo "you are in relationship with this person";
}
else if($access['status'] == Model_UserRelations::PENDING_FRIEND)
{
	if($my_uid == $access['sender_uid']) echo "Awaiting friend confirmation";
	else echo "accept friend request fom email.";
}
else if($access['status'] == Model_UserRelations::FRIEND)
{
	echo "you are friend with this person";
}
else if($access['status'] = Model_UserRelations::NO_RELATION)
{
	echo "<div><a class='invite_btn' href='#'
		onClick='javascript:invite(this, \"$invite_url\");'> Add friend</a></div>";
}
} ?>
<div id='profile'>
<ul class='my_tabs' id='profile_tabs' default='0'>
  <li tabid='social'>Social</li>
  <li tabid='professional'>Professional</li>
  <li tabid='personal'>Personal</li>
  <li tabid='profile_pic'>Profile Pic</li>
</ul><?php $action_url = My_URL::app_url("user/edit");?>
<div id='social'>
	<form action="<?php echo $action_url;?>" method=POST>
	<table class='profile_edit'>
	<tr><td>About us</td><td><textarea name='about_me' class='fullwidth'><?php echo $data['about_me'];?></textarea></td></tr>
	<!-- tr><td>Relationship Status</td><td><select><option value='commited'>Commited</option><option value='engaged'>Engaged</option><option value='married'>Married</option></select></td></tr> -->
	<tr><td>Languages</td><td><input type="text" name='lang' class='fullwidth' value='<?php echo $data['lang'];?>'></td></tr>
	<tr><td>Religion</td><td><input type="text" name='religion' class='fullwidth' value='<?php echo $data['religion'];?>'></td></tr>
	<tr><td>Sport</td><td><input type="text" name='sports' class='fullwidth' value='<?php echo $data['sports'];?>'></td></tr>
	<tr><td>Books</td><td><input type="text" name='books' class='fullwidth' value='<?php echo $data['books'];?>'></td></tr>
	<tr><td>Music</td><td><input type="text" name='songs' class='fullwidth' value='<?php echo $data['songs'];?>'></td></tr>
	<tr><td>TV Shows</td><td><input type="text" name='tv_shows' class='fullwidth' value='<?php echo $data['tv_shows'];?>'></td></tr>
	<tr><td>Movies</td><td><input type="text" name='movies' class='fullwidth' value='<?php echo $data['movies'];?>'></td></tr>
	<tr><td>Cuisines</td><td><input type="text" name='cuisines' class='fullwidth' value='<?php echo $data['cuisines'];?>'></td></tr>
	<tr><td></td><td><input type='submit' value='submit'></td></tr>
	</table>
	</form>
</div>
<div id='professional'>
	<div class='profile_title'>Professional</div>
	<form action="<?php echo $action_url;?>" method=POST>
	<table class='profile_edit'>
	<tr><td>High School</td><td><input type="text" name='hschool' class='fullwidth' value='<?php echo $data['hschool'];?>'></td></tr>
	<tr><td>Collage/University</td><td><input type="text" name='clg' class='fullwidth' value='<?php echo $data['clg'];?>'></td></tr>
	<tr><td>Occupation</td><td><input type="text" name='occupation' class='fullwidth' value='<?php echo $data['occupation'];?>'></td></tr>
	<tr><td>Work Email</td><td><input type="text" name='wemail' class='fullwidth' value='<?php echo $data['wemail'];?>'></td></tr>
	<tr><td>Work Phone</td><td><input type="text" name='phone' class='fullwidth' value='<?php echo $data['phone'];?>'></td></tr>
	<tr><td></td><td><input type='submit' value='submit'></td></tr>
	</table>
	</form>
</div>
<div id='personal'>
	<div class='profile_title'>Personal</div>
	<form action="<?php echo $action_url;?>" method=POST>
	<table class='profile_edit'>
	<tr><td>How did you meet?</td><td><input type="text" name='meet_how' class='fullwidth' value='<?php echo $data['meet_how'];?>'></td></tr>
	<tr><td>When did you meet?</td><td><input type="text" name='meet_time' class='fullwidth' value='<?php echo $data['meet_time'];?>'></td></tr>
	<tr><td>First Date</td><td><input type="text" name='meet_desc' class='fullwidth' value='<?php echo $data['meet_desc'];?>'></td></tr>
	<tr><td>What do you think about a relationship?</td><td><input type="text" name='rel_think' class='fullwidth' value='<?php echo $data['rel_think'];?>'></td></tr>
	<tr><td>Who proposed to whom and how?</td><td><input type="text" name='propose' class='fullwidth' value='<?php echo $data['propose'];?>'></td></tr>
	<tr><td></td><td><input type='submit' value='submit'></td></tr>
	</table>
	</form>
</div>
<div id='profile_pic'>
	<form enctype='multipart/form-data' action="<?php echo $action_url;?>" method=POST>
	<div>Profile pic:<img src='<?php echo $data['pic_url'];?>' width="100" height="100"></img></div>
	<div>Profile pic:<input type="file" name='pic'></div>
	<input type='submit' value='upload'>
	</form>
</div>
</div>
<?php if(isset($view_only) && $view_only) {?>
<script>
$('#profile input').each(function(){$(this).attr('disabled', 'disabled');});
$('#profile textarea').each(function(){$(this).attr('disabled', 'disabled');});
</script>
<?php }?>